home *** CD-ROM | disk | FTP | other *** search
/ Small Time Crooks Press Kit / Small Time Crooks Press Kit.iso / pc / Small Time Crooks.dxr / Scripts_23_Video Select-Toggle Button.ls < prev    next >
Encoding:
Text File  |  2000-04-30  |  2.9 KB  |  82 lines

  1. property pVideoName, pWhatChanges, pWhatShows, pDestination, pGroupName, pInitialState, pNumStates, pComplexString, ancestor
  2. global gCurrentVideo
  3.  
  4. on beginSprite me
  5.   set previousItemDelimiter to the itemDelimiter
  6.   set the itemDelimiter to "."
  7.   set pVideoName to item 1 of the name of the member of sprite the spriteNum of me
  8.   set the itemDelimiter to previousItemDelimiter
  9.   if pWhatShows = #gCurrentVideoStatus then
  10.     if pInitialState = #on then
  11.       set gCurrentVideo to pVideoName
  12.       sendAllSprites(#UpdateDetail, #video)
  13.     end if
  14.   end if
  15.   if pNumStates = #complex then
  16.     set pNumStates to value(pComplexString)
  17.   end if
  18.   set numTrans to pNumStates
  19.   if pWhatShows = #nothing then
  20.     set togSty to 0
  21.   else
  22.     set togSty to 1
  23.   end if
  24.   set selfTog to pWhatChanges = pWhatShows
  25.   set togGrup to pGroupName
  26.   set togState to pInitialState
  27.   set togOffbl to 0
  28.   if pWhatChanges = #gCurrentVideoStatus then
  29.     set togOnOthOff to 1
  30.   else
  31.     set togOnOthOff to 0
  32.   end if
  33.   set ancestor to new(script "Bitmap But 1", the spriteNum of me, numTrans, togSty, togGrup, togState, togOffbl, selfTog, togOnOthOff)
  34. end
  35.  
  36. on MouseUpAction me
  37.   if pWhatChanges = #gCurrentVideoStatus then
  38.     set gCurrentVideo to pVideoName
  39.     sendAllSprites(#UpdateDetail, #video)
  40.   end if
  41.   if pDestination <> EMPTY then
  42.     go(pDestination)
  43.   end if
  44. end
  45.  
  46. on MouseDownAction me
  47.   nothing()
  48. end
  49.  
  50. on MouseEnterAction me
  51.   nothing()
  52. end
  53.  
  54. on MouseLeaveAction me
  55.   nothing()
  56. end
  57.  
  58. on getPropertyDescriptionList me
  59.   set description to [:]
  60.   addProp(description, #pInitialState, [#default: #off, #format: #symbol, #comment: "Initial State", #range: [#off, #on]])
  61.   addProp(description, #pWhatChanges, [#default: #gCurrentVideoStatus, #format: #symbol, #comment: "What It Changes", #range: [#nothing, #gCurrentVideoStatus]])
  62.   addProp(description, #pWhatShows, [#default: #gCurrentVideoStatus, #format: #symbol, #comment: "What It Shows", #range: [#nothing, #gCurrentVideoStatus]])
  63.   addProp(description, #pGroupName, [#default: "VideoButtons", #format: #string, #comment: "Toggle Group Name"])
  64.   addProp(description, #pDestination, [#default: EMPTY, #format: #string, #comment: "Frame Destination"])
  65.   addProp(description, #pNumStates, [#default: 3, #format: #symbol, #comment: "Number of States", #range: [2, 3, 4, 5, 6, #complex]])
  66.   addProp(description, #pComplexString, [#default: "[[1,0],[1,0],[1,0],[#m,0],[#m,0],[#m,0]]", #format: #string, #comment: "Complex State Description"])
  67.   return description
  68. end
  69.  
  70. on getBehaviorDescription me
  71.   set endChar to offset("--END OF HEADER", the text of me)
  72.   set endLine to the number of lines in char 1 to endChar of the text of me - 1
  73.   set description to line 1 to endLine of the text of me
  74.   repeat with whichLine = endLine down to 1
  75.     if line whichLine of description = EMPTY then
  76.       delete line whichLine of description
  77.     end if
  78.   end repeat
  79.   delete line 1 of description
  80.   return description
  81. end
  82.